package cn.cs.client;

import cn.cs.common.Dto;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.RepairOrderFallBack;
import cn.cs.pojo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = RepairOrderFallBack.class)
public interface RestRepairOrderClient {


    @RequestMapping(value = "/getUserOrderType", method = RequestMethod.POST)
    public List<String> getUserOrderType(@RequestParam("appId") String userId) throws Exception;

    @RequestMapping(value = "/getAppOrderByUserId", method = RequestMethod.POST)
    public List<Map<String, Object>> getAppOrderByUserId(@RequestParam("userId") String userId) throws Exception;

    @RequestMapping(value = "/getAppOrderByOrderState", method = RequestMethod.POST)
    public List<Map<String, Object>> getAppOrderByOrderState(@RequestParam("userId") String userId) throws Exception;

    @RequestMapping(value = "/getRepairOrderByOrderState", method = RequestMethod.POST)
    public List<Map<String, Object>> getRepairOrderByOrderState(@RequestParam("userId") String userId) throws Exception;

    @RequestMapping(value = "/getRepairOrderList", method = RequestMethod.POST)
    public List<RepairOrder> getRepairOrderList(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getRepairOrderListByMap", method = RequestMethod.POST)
    public List<RepairOrder> getRepairOrderListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getRepairOrderCountByMap", method = RequestMethod.POST)
    public Integer getRepairOrderCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addRepairOrder", method = RequestMethod.POST)
    public Integer addRepairOrder(@RequestBody RepOrder repairOrder) throws Exception;

    @RequestMapping(value = "/getOrderDetailsByOrderId", method = RequestMethod.POST)
    public Map<String, Object> getOrderDetailsByOrderId(@RequestParam("orderId") String orderId, @RequestParam("type") String type) throws Exception;

    @RequestMapping(value = "/getRepOrderByAppOrderId", method = RequestMethod.POST)
    public Map<String, Object> getRepOrderByAppOrderId(@RequestParam("appOrderId") String appOrderId);

    @RequestMapping(value = "/queryRepairOrderAgentProfitAll", method = RequestMethod.POST)
    public Dto queryRepairOrderAgentProfitAll(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getClientUserById", method = RequestMethod.POST)
    public ClientUser getClientUserById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/getTestReportById", method = RequestMethod.POST)
    public Map<String, Object> getTestReportById(@RequestParam("orderNo") String orderNo)throws Exception;

    @RequestMapping(value = "/getAfterOrderByOrderId", method = RequestMethod.POST)
    public List<AfterOrder> getAfterOrderByOrderId(@RequestParam("orderId") String orderId)throws Exception;

    @RequestMapping(value = "/getAppOrderByMap", method = RequestMethod.POST)
    public List<Map<String, Object>> getAppOrderByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAllByMap", method = RequestMethod.POST)
    public List<Map<String, Object>> getAppOrderAllByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getRepairOrderRepairUserCountByMap", method = RequestMethod.POST)
    public Integer getRepairOrderRepairUserCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAllRepairUserByMap", method = RequestMethod.POST)
    public List<Map<String, Object>> getAppOrderAllRepairUserByMap(@RequestBody Map<String, Object> param)throws Exception;


    @RequestMapping(value = "/getAppOrderAgentACountByMap", method = RequestMethod.POST)
    public Integer getAppOrderAgentACountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAgentAByMap", method = RequestMethod.POST)
    public List<RepairOrder> getAppOrderAgentAByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAgentBCountByMap", method = RequestMethod.POST)
    public Integer getAppOrderAgentBCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAgentBByMap", method = RequestMethod.POST)
    public List<RepairOrder> getAppOrderAgentBByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAgentAProfitAll", method = RequestMethod.POST)
    public Double getAppOrderAgentAProfitAll(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAgentBProfitAll", method = RequestMethod.POST)
    public Double getAppOrderAgentBProfitAll(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/updateRepairOrder", method = RequestMethod.POST)
    public Integer updateRepairOrder(@RequestBody RepairOrder repairOrder)throws Exception;

    @RequestMapping(value = "/getUserBalanceByUserId", method = RequestMethod.POST)
    public ClientUser getUserBalanceByUserId(@RequestParam("userId") String userId)throws Exception;

    @RequestMapping(value = "/getRepairOrderById", method = RequestMethod.POST)
    public Map<String, Object> getRepairOrderById(@RequestParam("orderNo") String orderNo)throws Exception;

    @RequestMapping(value = "/updateAppOrderStatus", method = RequestMethod.POST)
    public Integer updateAppOrderStatus(@RequestParam("orderId") String orderId, @RequestParam("order_state") String order_state)throws Exception;

    @RequestMapping(value = "/insertAccoutDetails", method = RequestMethod.POST)
    public Integer insertAccoutDetails(@RequestBody AccountDetail accountDetail);

    @RequestMapping(value = "/updateUserBalance", method = RequestMethod.POST)
    public Integer updateUserBalance(@RequestParam("balance") Double balance, @RequestParam("id") String id);

    @RequestMapping(value = "/getRepairsOrderById", method = RequestMethod.POST)
    public RepairOrder getRepairsOrderById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/updateUserOrderNumber", method = RequestMethod.POST)
    public Integer updateUserOrderNumber(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getOrderByRepUserId", method = RequestMethod.POST)
    public List<Map<String, Object>> getOrderByRepUserId(@RequestParam("rep_user_id") String rep_user_id)throws Exception;

    @RequestMapping(value = "/updateRepOrderStatusMoney", method = RequestMethod.POST)
    public Integer updateRepOrderStatusMoney(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/updateRapairOrderStatus", method = RequestMethod.POST)
    public Integer updateRapairOrderStatus(@RequestBody RepOrder repOrder);

    //支付成功修改检测报告订单状态
    @RequestMapping(value = "/updateTestReportStatus", method = RequestMethod.POST)
    public Integer updateTestReportStatus(@RequestParam("rep_order_id") String rep_order_id, @RequestParam("app_order_id") String app_order_id, @RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getBillOrderDetailsByOrderId", method = RequestMethod.POST)
    public Map<String, Object> getBillOrderDetailsByOrderId(@RequestParam("orderId") String OrderId);

    @RequestMapping(value = "/getBillOrderImgByOrderId", method = RequestMethod.POST)
    public List<Map<String, Object>> getBillOrderImgByOrderId(@RequestParam("orderId") String OrderId);

    @RequestMapping(value = "/updateOrderStatusByAppId", method = RequestMethod.POST)
    public Integer updateOrderStatusByAppId(@RequestParam("order_state") String order_state, @RequestParam("appId") String appId);

    @RequestMapping(value = "/getInsurancePremiumCount", method = RequestMethod.POST)
    public Map<String, Object> getInsurancePremiumCount(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getInsurancePremiumByMap", method = RequestMethod.POST)
    public List<Map<String, Object>> getInsurancePremiumByMap(@RequestBody Map<String, Object> param) throws Exception;

    /**
     * 修改维修工的星级
     * @param star
     * @return
     */
    @RequestMapping(value = "/updateRepairUserStar", method = RequestMethod.POST)
    public Integer updateRepairUserStar(@RequestParam(value = "star") Long star, @RequestParam(value = "orderId") String orderId);


    @RequestMapping(value = "/updateOrderStateAAgent", method = RequestMethod.POST)
    public Integer updateOrderStateAAgent(@RequestParam("id)") String id)throws Exception;

    @RequestMapping(value = "/updateOrderStateBAgent", method = RequestMethod.POST)
    public Integer updateOrderStateBAgent(@RequestParam("id)") String id)throws Exception;


    @RequestMapping(value = "/getAppOrderAgentAProfitAllNew", method = RequestMethod.POST)
    public Double getAppOrderAgentAProfitAllNew(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getAppOrderAgentAByMapNew", method = RequestMethod.POST)
    public List<Map<String, Object>> getAppOrderAgentAByMapNew(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getOrderById", method = RequestMethod.POST)
    public Map<String, Object> getOrderById(@RequestParam("id") String id)throws Exception;


    @RequestMapping(value = "/updateOrderStatus", method = RequestMethod.POST)
    public Integer updateOrderStatus(@RequestParam("id") String id, @RequestParam("app_order_id") String app_order_id, @RequestParam("agentAId") String agentAId, @RequestParam("agentBId") String agentBId)throws Exception;
}
